<%-- 
    Document   : danhsachsanphamtheoloaicontent
    Created on : Oct 1, 2011, 10:52:24 AM
    Author     : Administrator
--%>

<%@page import="org.hibernate.HibernateException"%>
<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="java.util.List"%>
<%@page import="java.text.DecimalFormat" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Deal Zing | Danh sách Deal theo loại</title>
<link href="DealZing_files/6aad5646.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- Lấy dữ liệu từ server -->
<%
    try
    {
        DecimalFormat df = new DecimalFormat("###,###");
        //List<Sanpham> arrSanPham = (List<Sanpham>)request.getAttribute("DanhSachSanPhamTheoLoai");
        List<Sanpham> arrSanPham = (List<Sanpham>)session.getAttribute("DanhSachSanPhamTheoLoai");
        Sanpham dealhot = arrSanPham.get(0);
        if(arrSanPham!=null)
        {
%>            
            
<!-- Kết thúc lấy dữ liệu từ server -->

<!-- Bắt đầu trang Hot Deal -->
<div class="BoxDealHot">
<div class="BoxDealHotTop">
    <div class="BoxDealHotBottom">
        <h2>
            <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=dealhot.getMaSanPham()%>"><%=dealhot.getTenSanPham()%> </a>
        </h2>
        <div class="Des">
            <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=dealhot.getMaSanPham()%>" title="<%=dealhot.getTenSanPham()%>" class="Left">
                <img src="<%=dealhot.getAnhDaiDien()%>" class="" alt="[Hình:<%=dealhot.getTenSanPham()%>]" title="Click để xem chi tiết" width="450" height="276" />
            </a>
            <div class="Price">
                <div class="PriceTop">
                    <div class="PriceBot">
                        <ul class="Coup">
                            <li>
                                <ul>
                                    <li>
                                        <p>Trị giá</p>
                                        <p class="TextCoup"><span class="c cr" title=""><%=df.format(dealhot.getTriGia())%></span><sup class="TextDv">đ</sup></p>
                                    </li>
                                    <li class="Last">
                                        <p>Tiết kiệm </p>
                                        <p class="TextSave"><span class="c cr" title=""><%=df.format(dealhot.getTietKiem())%></span><sup class="TextDv">đ</sup></p>
                                    </li>
                               </ul>
                            </li>
                            <li>
                                <a href="http://deal.zing.vn/deals/buy/689/type:gift/tc:1317093439/city:tp-ho-chi-minh" class="JsDealBuyGift JsNoChildrenDeal">
                                    <img src="DealZing_files/qua00000.jpg" height="26" width="22" class="Left" alt="" /><strong class="TextFriend">Mua tặng bạn bè!</strong></a>                            <span class="JsDealId">689</span>
                            </li>
                            <li class="Last"><img src="DealZing_files/check000.jpg" height="25" width="25" class="Left" alt="" />
                                <span class="TextFriend"><strong class="Textnum"><%=dealhot.getLuotMua()%></strong> lượt mua</span>
                            </li>
                      </ul>
                    </div>
                </div>
            </div>
            <div class="Price">
                <div class="PriceTop">
                    <div class="PriceBot">
                        <div class="TimeHome">
                            <img src="DealZing_files/donghoca.jpg" height="35" width="19" class="Dongho" alt="" />
                            <div class="Time">
                                <p>Thời gian còn lại :</p>
                                <div class="js-deal-end-countdown">&nbsp;</div>
                                <span class="js-time hide"><%=dealhot.getNgayHetHanKhuyenMai()%></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="MuaDeal">
                <div class="GiaTot">
                    <p><strong>Giá bán</strong></p>
                    <p><strong class="TextBuy"><span class="c cr" title=""><%=df.format(dealhot.getGiaBan())%></span></strong><span class="GiaDv">đ</span></p>
                </div>
                <a href="cartcontroller?action=buy&amp;maSanPham=<%=dealhot.getMaSanPham()%>" title="Mua" class="BuyDeal JsNoChildrenDeal">Mua</a><span class="JsDealId">689</span>
            </div>
        </div>
    </div>
</div>
</div>
<!-- Kết thúc trang Hot Deal -->
<%
            for(int i=1; i<arrSanPham.size(); i++)
            {
                Sanpham sanpham = arrSanPham.get(i);
                if(i%2!=0)
                {
%>

<div class="BoxBuyOld">
    <div class="BoxBuyOldTop">
        <div class="BoxBuyOldBot">
            <h3><a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="Click để xem chi tiết"><%=sanpham.getTenSanPham()%></a></h3>
            <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="Click để xem chi tiết">
            <img src="<%=sanpham.getAnhDaiDien()%>" class="ImgSpace" alt="[<%=sanpham.getTieuDeSanPham()%>]" title="Click để xem chi tiết" width="450" height="276" />
            </a>
            <div class="Des">
                <div class="Gia">
                    <p><span class="TextLeft">Trị giá</span><strong class="TienOld"><span class="c cr" title=""><%=df.format(sanpham.getTriGia())%></span>đ</strong></p>
                    <p><span class="TextLeft">Tiết kiệm </span><strong class="TietkiemOld"><span class="c cr" title=""><%=df.format(sanpham.getTietKiem())%></span>đ</strong></p>
                </div>
                <div class="GiaOld">
                    <div class="Money">
                        <strong class="MoneyOld"><span class="c cr" title=""><%=df.format(sanpham.getGiaBan())%></span></strong><strong class="MoneyDv">đ</strong>
                    </div>
                    <a href="cartcontroller?action=buy&amp;maSanPham=<%=dealhot.getMaSanPham()%>" title="Mua" class="BuyOld JsNoChildrenDeal">Mua</a><span class="JsDealId">685</span>
                </div>
            </div>
             <span class="line"></span>
             <div class="Bottom">
                <span class="TimeOld js-deal-end-countdown-2"></span>                            
                <span class="js-time hide"><%=sanpham.getNgayHetHanKhuyenMai()%></span>
                <span class="Soluong"><strong class="Text18"><%=sanpham.getLuotMua()%></strong> lượt mua</span>                                 
             </div>
        </div>
    </div>
</div>
<%
               }
               else
               {
%>            
<div class="BoxBuyOldLeft">
    <div class="BoxBuyOldTop">
        <div class="BoxBuyOldBot">
            <h3><a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="Click để xem chi tiết"><%=sanpham.getTenSanPham()%></a></h3>
            <a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="Click để xem chi tiết">
            <img src="<%=sanpham.getAnhDaiDien()%>" class="ImgSpace" alt="[<%=sanpham.getTieuDeSanPham()%>]" title="Click để xem chi tiết" width="450" height="276" />
            </a>
            <div class="Des">
                <div class="Gia">
                    <p><span class="TextLeft">Trị giá</span><strong class="TienOld"><span class="c cr" title=""><%=df.format(sanpham.getTriGia())%></span>đ</strong></p>
                    <p><span class="TextLeft">Tiết kiệm </span><strong class="TietkiemOld"><span class="c cr" title=""><%=df.format(sanpham.getTietKiem())%></span>đ</strong></p>
                </div>
                <div class="GiaOld">
                    <div class="Money">
                        <strong class="MoneyOld"><span class="c cr" title=""><%=df.format(sanpham.getGiaBan())%></span></strong><strong class="MoneyDv">đ</strong>   
                    </div>
                    <a href="cartcontroller?action=buy&amp;maSanPham=<%=dealhot.getMaSanPham()%>" title="Mua" class="BuyOld JsNoChildrenDeal">Mua</a><span class="JsDealId">688</span>
                </div>
            </div>
             <span class="line"></span>
             <div class="Bottom">
                <span class="TimeOld js-deal-end-countdown-2"></span>                            
                <span class="js-time hide"><%=sanpham.getNgayHetHanKhuyenMai()%></span>
                <span class="Soluong"><strong class="Text18"><%=sanpham.getLuotMua()%></strong> lượt mua</span>                                 
             </div>
        </div>
    </div>
</div>
<%
               }
            }
        }
    }catch(HibernateException ex)
    {
        out.println(ex);
    }
%>
</body>
</html>
